home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / pour.dxr / 00008_Window utils.ls < prev    next >
Encoding:
Text File  |  2000-03-23  |  1.5 KB  |  75 lines

  1. global gPourWindow, gOldPourRect
  2.  
  3. on closeWindow
  4. end
  5.  
  6. on adjustWindowHeight diff
  7.   if diff then
  8.     newRect = (the activeWindow).rect
  9.     newRect.top = newRect.top + diff
  10.     (the activeWindow).rect = newRect
  11.   end if
  12. end
  13.  
  14. on baseRect
  15.   return rect(0, 0, (the activeWindow).sourceRect.width, (the activeWindow).sourceRect.height)
  16. end
  17.  
  18. on textView
  19.   global gTextViewHeight
  20.   gTextViewHeight = 102
  21.   (the activeWindow).drawRect = baseRect()
  22.   adjustWindowHeight((the activeWindow).rect.height - gTextViewHeight)
  23. end
  24.  
  25. on noTextView
  26.   global gNoTextViewHeight
  27.   gNoTextViewHeight = 84
  28.   diff = (the activeWindow).rect.height - gNoTextViewHeight
  29.   (the activeWindow).drawRect = offset(baseRect(), 0, -diff)
  30.   adjustWindowHeight(diff)
  31. end
  32.  
  33. on openWindow
  34.   global gIngredients, gScroller
  35.   gScroller = sprite(22)
  36. end
  37.  
  38. on startMovie
  39.   if voidp(gPourWindow) then
  40.     gPourWindow = the activeWindow
  41.   end if
  42.   openWindow()
  43.   refreshPourItem(VOID, 0.0)
  44.   set the mouseDownScript to "resetFocusMouseDown"
  45.   set the mouseUpScript to "resetFocusMouseUp"
  46. end
  47.  
  48. on checkElapsedTime
  49. end
  50.  
  51. on stopMovie
  52.   refreshPourItem(VOID, 0.0)
  53. end
  54.  
  55. on refreshDrinkContents direction, flag
  56.   if the activeWindow <> the stage then
  57.     tell the stage
  58.       togglePourClockText(direction, flag)
  59.     end tell
  60.   end if
  61. end
  62.  
  63. on reinstateArrows direction
  64.   sendAllSprites(#mReinstate, direction)
  65. end
  66.  
  67. on refreshPourItem newVessel, newQuantity
  68.   if not voidp(newVessel) then
  69.     sendSprite(3, #mUpdate, newVessel)
  70.   end if
  71.   if not voidp(newQuantity) then
  72.     sendSprite(7, #mUpdate, newQuantity)
  73.   end if
  74. end
  75.